package com.cloudz.iptv.fragment.content.v1.adapter;


import android.content.Context;

import com.cloudz.iptv.R;
import com.cloudz.iptv.fragment.content.v1.adapter.data.ItemLiveChannel;
import com.owen.adapter.CommonRecyclerViewAdapter;
import com.owen.adapter.CommonRecyclerViewHolder;
import com.owen.adapter.CommonViewHolder;

import java.io.Serializable;
import java.util.List;

/**
 * 直播列表适配器
 */
public class LiveChannlAdapter extends CommonRecyclerViewAdapter implements Serializable
{
    public List datas;

    public LiveChannlAdapter(Context context, List datas)
    {
        super(context, datas);
        this.datas = datas;
    }

    public List getDatas()
    {
        return this.datas;
    }
    @Override
    public int getItemLayoutId(int viewType)
    {
        return R.layout.item_list_live_channel;
    }

    @Override
    public void onBindItemHolder(CommonRecyclerViewHolder helper, Object item, int position)
    {
        ItemLiveChannel itemMenuFooter = (ItemLiveChannel) item;

        CommonViewHolder holder = helper.getHolder();
        holder.setText(R.id.live_channel_no, String.format("%03d", position + 1));
        //holder.setImageResource(R.id.live_channel_img, itemMenuFooter.drawableId);
        holder.setText(R.id.live_channel_title, itemMenuFooter.title);

//        ImageView imageView = holder.getView(R.id.live_channel_img);
//
//        Glide.with(App.get()).load(itemMenuFooter.icon).into(imageView);

        //showImage(helper, R.id.footer_menus_img, item.);
    }
}
